const state = {
  /*
    使用:this.$store.state.user(模块名).userInfo
    */
  userInfo: '张三'
}
const mutations = {
  /*  
    mutations基本使用:this.$store.commit('setUserInfo',参数值)    
    */

  setUserInfo (state, value) {
    state.userInfo = value
  }
}
const actions = {
  /*
actions的基本使用:this.$store.dispatch('refreshUserInfo',实参值)
*/

  refreshUserInfo (store) {
    setTimeout(() => {
      store.commit('setUserInfo', Math.random() * 999)
    }, 2000)
  }
}
const getters = {
  /*
    getters基本使用:this.$store.getters.getUserInfo
    */

  getUserInfo (state) {
    return state.userInfo
  }
}
export default {
  //   namespaced: false, // 命名空间
  state,
  mutations,
  actions,
  getters
}

/*
let top={
    a:'123'
}

let bottom={
    a:'123',

}


*/
